<template>
    <div>
        <h3>科室添加</h3>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td align="right">科室名称</td>
                    <td><input type="text" v-model="arr.keShiName" /></td>
                </tr>
                <tr>
                    <td align="right">科室人数</td>
                    <td><input type="number" v-model="arr.keShiNum" /></td>
                </tr>
                <tr>
                    <td align="right">科室介绍</td>
                    <td>
                        <textarea v-model="arr.keShiJieShao"></textarea>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="button" value="添加" @click="ok" /></td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { reactive, ref, onMounted } from 'vue';
import axios from 'axios';
import { useRoute, useRouter } from 'vue-router';

let u = useRouter();

let arr: any = ref({
    "keShiName": "",
    "keShiNum": 0,
    "keShiJieShao": "",
    "createTime": "2025-02-13T07:36:58.845Z",
    "isDdel": true
});

const ok = () => {
    console.log(arr.value);

    axios({
        url: "https://localhost:7107/api/Doctor/KeshiAdd",
        data: arr.value,
        method: "post"
    })
        .then(res => {
            if (res.data > 0) {
                alert('添加成功');
                u.push("/");
            }
            else {
                alert('添加失败');
            }
        }
        )
}




</script>

<style scoped></style>